package com.mock.action.product;

import java.util.List;

import com.mock.dao.ProductDao;
import com.mock.dao.ProductTypeDao;
import com.mock.dao.impl.ProductDaoImpl;
import com.mock.dao.impl.ProductTypeDaoImpl;
import com.mock.model.Product;
import com.mock.model.ProductType;
import com.opensymphony.xwork2.ActionSupport;

public class EditProductAction extends ActionSupport{

	private ProductDao productDao = new ProductDaoImpl();
	private ProductTypeDao productTypeDao = new ProductTypeDaoImpl();
	private Product product ;
	private List<ProductType> productTypes;
	private Long id;
	public String execute() {
		
		product = productDao.getById(Product.class, id);
		productTypes = productTypeDao.getAllProductType();
		return SUCCESS;
	}
	
	public String updateProduct() {
		return SUCCESS;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public List<ProductType> getProductTypes() {
		return productTypes;
	}

	public void setProductTypes(List<ProductType> productTypes) {
		this.productTypes = productTypes;
	}
	
}

